﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _021_第二十一章_单例模式
{
    class Program
    {
        static void Main(string[] args) 
        {
            Singleton01 s1 = Singleton01.Instance;
            Singleton01 s2 = Singleton01.Instance;

            if(s1 == s2)
            {
                Console.WriteLine("实例化的两个类相同。");
                Console.WriteLine(s1.GetType());
                Console.WriteLine(s1.GetHashCode());
            }

            Console.ReadKey();
        }
    }
}
